package com.example.fufudamowang.intent;

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.view.View.OnClickListener;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    private Button myButton = null;


        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            myButton = (Button)findViewById(R.id.myButton);
            myButton.setOnClickListener(new MyButtonListener());
        }
        class MyButtonListener implements OnClickListener{
            @Override
            public void onClick(View v) {
                Toast.makeText(MainActivity.this,"chufa",Toast.LENGTH_SHORT).show();
                Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel://13926333473"));
                startActivity(intent);
            }
        }

}
